package net.sxnic.ugr.resource.action;

import net.sxnic.comm.log.Log;
import net.sxnic.ugr.context.AppContext;
import net.sxnic.ugr.resource.Resource;

/**
 * @version $Revision$
 * @author 张国业 create 2013-4-11
 */
@SuppressWarnings("serial")
public class Delete extends ResourceAction {

	public String execute() throws Exception {
		
		 try {						
			 	checkRoles(Resource.SYSTEM_ADMIN);
			 	resourceManager.deleteById(id);
				 
				// 保存删除成功的信息
				 msg = "deleteSuccess";
				// 日志
				addLog(Log.LOG_OPERATION_DLETE, AppContext.getUserName(request)
						+ " delete permisssion sucess! permisssion id:" + id);
				
			} catch (Exception e) {
				e.printStackTrace();
			}
		return SUCCESS;
	}

}
